#include "ControlLine.h"

ControlLine::ControlLine()
{
}

ControlLine::~ControlLine()
{

}

bool ControlLine::init()
{
	if (cocos2d::Sprite::init())
	{
		setTexture("enenryArrow2.png");
		setAnchorPoint(cocos2d::ccp(0, 0.5));
		return true;
	}

	return false;
}

void ControlLine::setLine(const cocos2d::Vec2 &sourPos, const cocos2d::Vec2 &destVec)
{
	setPosition(sourPos);
	setScaleX(destVec.length() / getContentSize().width);
	setRotation(-CC_RADIANS_TO_DEGREES(destVec.getAngle()));
}